import 'package:flutter/material.dart';

class EditorArea extends StatelessWidget {
  final TextEditingController textController;

  const EditorArea({
    super.key,
    required this.textController,
  });

  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Column(
        children: [
          // 工具栏
          Container(
            height: 40,
            color: Colors.grey[50],
            child: Row(
              children: [
                IconButton(
                  icon: const Icon(Icons.format_bold),
                  onPressed: () {},
                ),
                IconButton(
                  icon: const Icon(Icons.format_italic),
                  onPressed: () {},
                ),
                IconButton(
                  icon: const Icon(Icons.format_underline),
                  onPressed: () {},
                ),
                const VerticalDivider(width: 1),
                IconButton(
                  icon: const Icon(Icons.format_list_bulleted),
                  onPressed: () {},
                ),
                IconButton(
                  icon: const Icon(Icons.format_list_numbered),
                  onPressed: () {},
                ),
              ],
            ),
          ),
          const Divider(height: 1),
          // 文本编辑区域
          Expanded(
            child: Padding(
              padding: const EdgeInsets.all(16.0),
              child: TextField(
                controller: textController,
                maxLines: null,
                expands: true,
                decoration: const InputDecoration(
                  border: InputBorder.none,
                  hintText: '输入笔记内容...',
                ),
                style: const TextStyle(fontSize: 16),
              ),
            ),
          ),
        ],
      ),
    );
  }
}